package io.admin.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.admin.common.service.impl.CrudServiceImpl;
import io.admin.modules.sys.dao.EditionDao;
import io.admin.modules.sys.dto.EditionDTO;
import io.admin.modules.sys.entity.EditionEntity;
import io.admin.modules.sys.service.EditionService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 版本管理
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2024-07-04
 */
@Service
public class EditionServiceImpl extends CrudServiceImpl<EditionDao, EditionEntity, EditionDTO> implements EditionService {

    @Override
    public QueryWrapper<EditionEntity> getWrapper(Map<String, Object> params){
        String name = (String)params.get("name");
        String number = (String)params.get("number");
        QueryWrapper<EditionEntity> wrapper = new QueryWrapper<>();
        wrapper.like(StrUtil.isNotBlank(name), "name", name);
        wrapper.like(StrUtil.isNotBlank(number), "number", number);
        return wrapper;
    }


}